package com.android.djlmapp.adapter.order;

import android.content.Context;

import com.android.djlmapp.R;
import com.android.djlmapp.model.order.OrderListInfo;

import org.refresh_view.pullrecyclerview.BaseViewHolder;

/**
 * @Author wangziheng
 * @ProjectName djlm
 * @ClassName BroadBandOrderListAdapter
 * @package com.android.djlmapp.adapter.order
 * @data 2018/12/12 12:29
 * @Describe 宽带订单
 * @Change
 */
public class BroadBandOrderListAdapter extends OrderListAdapter {
    public BroadBandOrderListAdapter(Context context) {
        super(context);
    }

    @Override
    protected void convert(BaseViewHolder holder, OrderListInfo.DataBean item) {
        super.convert(holder, item);
        mOrderNameTv.setText(item.getName_type());
        mOrderNameTv.setTextColor(holder.itemView.getContext().getResources().getColor(R.color.black));
        holder.setText(R.id.order_list_orderPrice_tv,"¥:  " + item.getOrder_money());
        holder.setImageResource(R.id.order_list_goodsIcon_img,R.mipmap.order_bb_icon);
    }
    @Override
    public String[] getOrderStatusValue(String orderStatusCode,String orderType) {
        String[] orderStatusValue = new String[2];
        switch (orderStatusCode){
            case "1":
                orderStatusValue[0] = "未付款";
                orderStatusValue[1] = COLOR_FF4081;
                break;
            case "2":
            case "5":
                orderStatusValue[0] = "处理中";
                orderStatusValue[1] = COLOR_ff600a;
                break;
            case "3":
                orderStatusValue[0] = "已完成";
                orderStatusValue[1] = COLOR_00ba23;
                break;
            case "4":
                orderStatusValue[0] = "已取消";
                orderStatusValue[1] = COLOR_b9b9b9;
                break;
            default:
                orderStatusValue[0] = "暂无状态";
                orderStatusValue[1] = COLOR_FF4081;
                break;
        }
        return orderStatusValue;
    }
}
